package com.geekhalo.admin.app.menu;

import com.geekhalo.admin.domain.menu.create.CreateMenuCommand;
import com.geekhalo.admin.domain.menu.create.CreateMenuContext;
import com.geekhalo.admin.domain.menu.update.UpdateMenuCommand;
import com.geekhalo.admin.domain.menu.update.UpdateMenuContext;
import com.geekhalo.lego.core.command.CommandApplicationServiceDefinition;
import com.geekhalo.lego.core.command.CommandMethodDefinition;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import com.geekhalo.admin.domain.menu.MenuCommandRepository;
import com.geekhalo.admin.domain.menu.Menu;

@CommandApplicationServiceDefinition(
        domainClass = Menu.class,
        repositoryClass = MenuCommandRepository.class
)
@Validated
public interface MenuCommandApplication {

    @CommandMethodDefinition(contextClass = CreateMenuContext.class)
    Menu create(@Valid CreateMenuCommand command);

    @CommandMethodDefinition(contextClass = UpdateMenuContext.class)
    void update(@Valid UpdateMenuCommand command);
}
